Windshield fog detector

ABSTRACT

The system of the present invention is configured to detect moisture on a surface and includes a sensor that may be divided into a plurality of subwindows. At least one of the subwindows has a sensitivity that is independently variable. The system may further include an optical system operative to direct light rays from at least a portion of the surface onto the sensor, and a processing system in communication with the sensor and operative to independently adjust the sensitivity of the at least one subwindow and to analyze data from the sensor to detect moisture. The processing system may control the windshield wipers based upon a number of subwindows in which moisture is detected.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.09/970,728 filed on Oct. 4, 2001 now U.S. Pat. No. 6,681,163. The entiredisclosure of which is incorporated herein by reference.

BACKGROUND OF THE INVENTION

The present invention relates to a system for automatically detectingthe presence of moisture on a surface, such as the surface of awindshield of a vehicle for an automobile, in order to automaticallyactuate the vehicle's windshield wipers and/or defroster or defoggingsystem.

In conventional windshield wiper systems, the windshield wipers areactuated based on the elapsed time between wipes rather than themoisture level on the exterior of the windshield. During conditions ofrelatively consistent rainfall, for example, the time interval can beadjusted to correspond to the amount of time in which the rainaccumulates to the point of the desired visibility level. Unfortunately,the rate of rainfall may vary dramatically over a given period of time.Additionally, traffic conditions may also cause varying amounts of rainto fall on the windshields, such as when a truck passes by. As a result,during such conditions, the driver must frequently adjust the wiper timeinterval, which can be cumbersome.

Various systems are known which automatically control the intervalbetween wipes of the windshield wipers based upon moisture on thevehicle windshield. In some known systems, various coatings are appliedto the vehicle windshield. Electrical measurement of those coatings isused to provide an indication of the moisture content on the windshield.Unfortunately, such methods require relatively expensive processes,which makes such systems commercially non-viable. Other systems forautomatically sensing the moisture content on a vehicle windshield arealso known. For example, optical systems are known which measure thedifference of reflected light of a dry windshield versus a wetwindshield. Unfortunately, such optical systems are susceptible tointerference from external light sources and thus provide inadequateperformance. Other known systems must be adhered to the windshield,which complicates the windshield replacement. As a result of suchcomplications, moisture sensors are rarely found on vehicles.

Another system for automatically detecting the moisture content on awindshield is disclosed in Japanese Laid Open Patent Application No. Hei(1995)-286130, which describes the use of a charge coupled device (CCD)image sensor to image a portion of the vehicle windshield in order todetect raindrops. The system described therein computes the sum of thedifferences between each pixel and the average of all pixels.Unfortunately, headlamps of oncoming vehicles will create a bright spotin the image, which would be difficult to completely blur and likely beinterpreted as rain. Moreover, in order for such a system to workeffectively, distant objects within the imaged scene must be completelyblurred. Otherwise, there will be dark and light regions in the imagedscene corresponding to the distant objects. Although there is no opticalsystem disclosed in the Japanese laid open patent application foraccomplishing this objective, it would be very difficult to develop anoptical system to completely blur an oncoming headlamp. Failure to bluroncoming headlamps could cause false triggering of the system disclosedin the above-identified Japanese laid open patent application.

Another problem with automatic rain detection systems is the inabilityof the system to detect the operation of the windshield wipers. Incertain cold climate conditions, the windshield wipers are known tofreeze to the windshield. In such a situation, since the moisture is notbeing removed by the wipers, an automatic rain sensing device wouldcontinuously command the wipers to actuate, even though the wipers arefrozen to the windshield, potentially damaging the windshield wipersystem.

Another problem with known systems is the inability to detect fog on theinterior and exterior of the windshields. As mentioned above, automaticmoisture detection systems, such as disclosed in the above-identifiedJapanese laid open patent application, are based upon the ability todetect raindrops on the windshield. When a uniform fog or mist coversthe vehicle windshield, systems, such as the system disclosed in theJapanese laid open patent application, are unable to sense such moistureon the exterior of the windshield. As a result, during such a condition,the windshield wipers will have to be manually actuated, therebypartially defeating the purpose of an automatic rain sensor andwindshield wiper control system making the feature a lot less desirable.

In other situations, fog develops on the inside of the windshieldindependent of the moisture content on the exterior of the windshield.In such a condition, automatic rain sensing systems, such as disclosedin the Japanese laid open patent application, are unable to detect themoisture content on the exterior of the vehicle windshield until afterthe fog on the interior of the windshield is cleared. In such acondition, a defroster or defogger system would have to be manuallyactuated to remove the interior fog on the windshield. The automaticrain sensor would not be operable during such a condition until the fogon the interior of the windshield is sufficiently cleared.

In commonly assigned U.S. Pat. Nos. 5,923,027, 6,097,024, and 6,262,410,a moisture sensing system is disclosed that overcomes the problems notedabove. Nevertheless, it would be desirable to further improve theability of the disclosed system to distinguish from light sources withinthe imaged scene that may cause false triggering of the windshieldwipers.

SUMMARY OF THE INVENTION

According to one embodiment of the present invention, a moisture sensingsystem is provided that comprises: a sensor that is divided into aplurality of subwindows each having a sensitivity that is variableindependent of the other subwindows; an optical system operative todirect light rays from at least a portion of the surface onto thesensor; and a processing system in communication with the sensor andoperative to adjust the sensitivity of the subwindows and to analyzedata from the sensor to detect moisture on the surface.

According to another embodiment of the invention, a system is providedfor detecting moisture on a surface that comprises: a sensor that isdivided into a plurality of subwindows, at least one of the subwindowshaving a sensitivity that is independently variable; an optical systemoperative to direct light rays from at least a portion of the surfaceonto the sensor; and a processing system in communication with thesensor and operative independently to adjust the sensitivity of the atleast one subwindow and to analyze data from the sensor to detectmoisture on the surface.

According to another embodiment of the present invention, a windshieldwiper control system for a vehicle is provided that comprises: a sensorthat is divided into a plurality of subwindows; an optical systemoperative to direct light rays from at least a portion of the surface ofthe windshield onto the sensor; and a processing system in communicationwith the sensor and operative to analyze data from the sensor todetermine whether moisture is detected in each subwindow and to controlthe windshield wipers based upon a number of subwindows in whichmoisture is detected.

According to another embodiment of the present invention, a windshieldwiper control system for a vehicle is provided that comprises: a sensor;an optical system operative to direct light rays from at least a portionof the surface of the windshield onto the sensor; and a processingsystem in communication with the sensor and operative to analyze datafrom the sensor to detect moisture on the windshield and toautomatically activate the windshield wipers when moisture is detected.The processing system is responsive to at least one remote device toenable or disable automatic control of the windshield wipers.

According to another embodiment of the present invention, a system fordetecting moisture on a surface is provided that comprises: an imagesensor array including a plurality of light sensors; an optical systemoperative to image at least a portion of the surface onto the imagesensor array; a supplemental illuminator for selectively illuminatingthe portion of the surface imaged onto the image sensor array; memoryfor storing a first image obtained by the image sensor array when thesupplemental illuminator is illuminating the portion of the surface, andfor storing a second image obtained by the image sensor array when thesupplemental illuminator is not illuminating the portion of the surface;and a processing system in communication with the memory, thesupplemental illuminator, and the image sensor array. The processingsystem is operative to compare the first and second images stored in thememory and to analyze results of the comparison to detect moisture onthe surface.

According to another embodiment of the present invention, a fog detectorsystem is provided for detecting fog on an inside surface of a vehiclewindow. The fog detector system comprises: an emitter for selectivelyprojecting radiation onto a region of the inside surface of the vehiclewindow; a sensor disposed with its optical axis substantially inparallel with that of the emitter, the sensor being sensitive to theradiation projected by the emitter for sensing levels of incidentradiation both when the emitter projects radiation and when the emitterdoes not project radiation; and a control circuit coupled to the emitterfor selectively activating the emitter, and coupled to the sensor forreceiving signals from the sensor representing the level of incidentradiation. The control circuit determines the difference between levelsof incident radiation when the emitter is activated and when the emitteris deactivated, and compares the difference to a threshold to determinewhether fog is present. When fog is present, the control circuitgenerates a signal indicating the presence of fog on the vehicle window.

These and other features, advantages, and objects of the presentinvention will be further understood and appreciated by those skilled inthe art by reference to the following specification, claims, andappended drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1 is a side elevational view showing a rearview mirror assemblyincorporating a moisture sensing system constructed in accordance withthe present invention;

FIG. 2 is an enlarged view showing the moisture sensing systemconstructed in accordance with the present invention;

FIG. 3 is a side elevational view showing the moisture sensing system inproximity to a vehicle windshield;

FIGS. 4A and 4B are computer simulated spot diagrams, which illustratethe performance of the optical system in accordance with the presentinvention during moisture and non-moisture conditions, respectively;

FIG. 5 is an enlarged view showing a moisture sensing system constructedin accordance with a second embodiment of the present invention;

FIG. 6 is a side elevational view of a portion of the moisture sensingsystem of the second embodiment shown relative to a vehicle windshield;

FIG. 7 is a block diagram of the moisture sensing system constructed inaccordance with the present invention;

FIG. 8 is a block diagram illustrating an image sensor array dividedinto various subwindows; and

FIG. 9 is a partial perspective view and electrical circuit diagram inblock form illustrating a fog detecting system constructed in accordancewith another embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

A moisture sensing system in accordance with the present invention isable to detect moisture on a surface such as the windshield of avehicle. Such a system is useful for automatically controlling thevehicle's windshield wipers, defroster, and/or defogging systems. Thesystem for sensing moisture on a vehicle windshield eliminates many ofthe performance deficiencies of known moisture sensing systems andprovides a moisture sensing system at a commercially viable cost. Asused herein, the term “moisture” is used to designate various types ofmoisture and precipitation which can be found on the windshield of avehicle during various climatic conditions, such as rainfall, snowfall,ice, and fog, as well as other substances that are commonly deposited ona vehicle windshield such as bugs, dust, and the like. The system isable to provide superior performance to other known systems duringrather common climatic conditions, such as ice, fog, and varying levelsof rain, snowfall, and the like.

Referring to FIG. 1, the moisture sensing system of a first embodimentof the present invention is generally identified with the referencenumeral 20. The moisture sensing system is preferably mounted stationaryin the mounting bracket 22 of an automobile rearview mirror 24 oralternatively mounted in the rear portion of the rearview mirror housing24. Further still, the moisture sensing system may be mounted elsewherein the vehicle. For example, the moisture sensing system could bemounted in a headliner, an overhead console, A-pillar, instrument paneldash, a windshield-mounted console, or in any other vehicle accessory.The moisture sensing system 20 includes an imaging system 30 including asensor array 32 mounted, for example, 55-105 mm behind the vehiclewindshield 26 with the optical axis substantially parallel to ground orslightly angled to the ground. The angle of the windshield 26 in amodern passenger car varies considerably from model to model. An exampleof the angle of a car windshield is about 27°. The windshield angle oftrucks may be much different. Such a configuration may cause theraindrops and other moisture to be at a different distance from theimage sensor array 32 depending on where the moisture is with respect tothe field of view of the image sensor array 32. To help compensate forthis problem, the image sensor array 32 may be angled toward thewindshield 26 such that the top of the image sensor 32 is moved closerto the windshield 26. For example, with a windshield angle of about 27°,image sensor 32 may be angled approximately 12-17° toward the windshield26.

There are four components to the inventive moisture sensing system 20 ofthe first embodiment: an imaging optical system; one or more lightemitting diodes; an image sensor array; and a processing system. Theimaging optical system is shown in FIGS. 2, 3, 5, and 6, while the imagesensor array is illustrated in FIGS. 2, 5, 7, and 8.

The imaging optical system is used to image a predetermined portion ofthe windshield 26 onto the sensor array 32 such that objects at theapproximate distance of the windshield 26 are more sharply in focus atthe image plane while objects at a longer distance are more out of focusand blurred. The area of the windshield 26 that is imaged should belarge enough that the probability of receiving raindrops duringrelatively light rain conditions is significant. Moreover, the imagedarea of the windshield should also be in the area of the windshield thatis wiped by the windshield wipers.

FIGS. 4A and 4B illustrate a computer simulation of the performance ofthe imaging system illustrated in FIG. 2. In particular, FIG. 4A is aspot diagram of the imaging of approximately parallel light rays from arelatively distant object on the optical axis onto an image plane. FIG.4B is a spot diagram of the imaging of a point on the optical axis atthe distance of the outer surface of the windshield. Upon comparison ofthe spot diagrams of FIGS. 4A and 4B, it is evident that the opticalsystem is able to blur light coming from distant objects while focusinglight from objects at the windshield distance.

The imaging optical system preferably includes a single aspheric lens 33(see FIGS. 2, 5, and 6). The lens may be carried by a mechanical lensmount 34, which forms a stop 36 about a 5 mm diameter directly in frontof the lenses. According to a preferred embodiment, lens 33 has adiameter of 9 mm, an edge thickness of 0.04009 mm, and a thickness alongthe central optical axis of 3.295987 mm. The lens is preferably made ofacrylic, which has a refractive index nD of 1.49167 and an Abbe numbervD of 55.31019. The object side surface has an effective radius ofcurvature of 7.377602 mm, a conic of −0.8590915 mm, and a second orderterm of 0.0390. The image side of lens 33 has an effective radius ofcurvature of −5.039234 mm, a conic of −1.500052 mm, and a second orderterm of 0.0556585. It will be appreciated, however, that one or morelenses having different constructions may likewise be used and that theinvention is not limited to the specific lens described above.

The image sensor array 32 is located behind the lens 33 and is slightlyangled by about 12-17°. It will be appreciated, however, that the angleat which image sensor array 32 is disposed is dependent upon the angleof the windshield, and thus the angle of the image sensor array 32 mayvary. Preferably, image sensor array 32 is angled relative to windshield26 such that the Scheimpflug condition is satisfied. The Scheimpflugcondition is discussed in “Modern Optical Engineering,” by Warren J.Smith (page 52). Basically, the Scheimpflug condition suggests that whenthe image plane is not parallel to the object plane, the optimal focusis obtained when the object and image planes intersect each other at theplane of the lens. Thus, by extending the plane of the lens upward todetermine where it intersects the windshield plane, the angle of theimage sensor array 32 may be determined by extending its plane from thepoint of intersection.

More elaborate optical systems, for example, with additional elements,aspherical elements, or defractive objects, could all be used especiallyif a shorter distance from the windshield is a desired feature. However,since the collected images are not for photographic purposes, suchoptical quality is not necessary in an application for moisturedetection.

The image sensor array 32 is preferably a CMOS active pixel imagesensor. CMOS active pixel image sensors provide low cost, highsensitivity imaging on a chip manufactured in a CMOS process. Such CMOSactive pixel image sensors have several advantages over other sensorsincluding low power consumption, popular CMOS production techniques, lowcost, ability to integrate additional circuitry on the same chip,variable read out windows, and a variable light integration time. SuchCMOS active pixel image sensors are commercially available from PhotobitInc., Pasadena, Calif., including, for example, Photobit part No.PB-0111. Suitable systems are described in detail in commonly assignedU.S. Pat. No. 5,990,469, entitled “CONTROL CIRCUIT FOR IMAGE ARRAYSENSORS,” by Jon H. Bechtel et al., and commonly assigned U.S. Pat. No.6,008,486, entitled “WIDE DYNAMIC RANGE OPTICAL SENSOR,” by Joseph S.Stam et al., the entire disclosures of which are incorporated herein byreference. The ability to obtain images from separate subwindows of theCMOS image sensor make it particularly suitable for the presentinvention in which the image sensor array 32 is divided into“subwindows.”

While CMOS active pixel image sensors have substantial advantages, otherimage sensors are also suitable and are considered to be within thescope of the present invention. The size and number of pixels isdetermined to image an area of the windshield sufficiently large and inenough detail to adequately detect light rain while remaining costeffective. A 64×80 active pixel array may be utilized or alternatively,a one-dimensional sensor array may be utilized. According to a morepreferred example, a Photobit PB-0111 Common Intermediate Format (CIF)Imager is used that has a 352×288 active pixel array with pixel spacingof 7.8 μm.

FIG. 5 shows an enlarged view of a moisture sensing system 100constructed in accordance with a second embodiment of the presentinvention. Moisture sensor system 100 generally includes all theelements of system 20 of the first embodiment, but additionally includesa supplemental illuminator 102, which may be an LED or other lightsource, an optional supplemental illuminator lens 104, and a window 106disposed in front of lenses 33, 68, and 104. Window 106 may include aphotocatalytic/hydrophilic coating 108 on an exterior surface thereof tomaintain a clear and clean surface, even in the presence of moisturedroplets or other contaminants that may form on the outer surface ofwindow 106. Such contaminants may include cleaners, grease, or the like.Examples of suitable photocatalytic/hydrophilic coatings are disclosedin commonly assigned U.S. Pat. No. 6,193,378, the entire of disclosureof which is incorporated herein by reference.

As shown in FIG. 6, supplemental illuminator 102 and supplementalilluminator lens 104 are configured so as to project light over the sameportion of windshield 26 that is imaged by lens 33 and image sensorarray 32. Supplemental illuminator 102 differs in this respect fromilluminator 66, which projects a small spot on the windshield for fogdetection. Supplemental illuminator 102 may be periodically activatedsuch that images are obtained with and without supplementalillumination. Such images may then be compared and analyzed to detectmoisture on the surface of the windshield. In relatively darkconditions, some image sensors may not be capable of collecting enoughlight in a reasonable time to adequately image moisture such asraindrops. In such a situation, supplemental illuminator 102 may brieflyilluminate the area of interest from behind while the images are beingtaken. If the windshield of the vehicle is not highly absorbent toinfrared radiation, supplemental illuminator 102 may be a near infraredilluminator as long as the wavelengths are within the detectable regionof the image sensor. An infrared illuminator has the benefit of notbeing visible to the human eye and thus not distracting to the driver.

Window 106 may also include an infrared cut filter having a narrowbandwidth around approximately 850 nm for passing infrared radiationcorresponding to that emitted from supplemental illuminator 102 whileblocking most other light. The filter could also be a narrow band bluefilter, but would preferably be infrared. The filter could be provideddirectly on or proximate the image sensor die.

A block diagram of the moisture sensing circuitry is shown in FIG. 7. Asmentioned above, a predetermined portion of the windshield 26 is imagedonto the image sensor array 32. The image sensor array is controlled bya processing system/circuit that also reads and processes the dataobtained from sensor array 32. The processing system includes ananalog-to-digital converter 35, a timing and control circuit 37, and amicrocontroller 38. The analog voltage of each of the pixels within thesensor 32 is converted to digitized grayscale value by way of theanalog-to-digital converter 35. The analog-to-digital converter 35 isoperated under the control of the timing and control circuit 37, which,in turn, is controlled by the microcontroller 38. The timing and controlcircuit 37 is described in detail in commonly assigned U.S. Pat. No.5,990,469, entitled “CONTROL CIRCUIT FOR IMAGE ARRAY SENSORS,” by Jon H.Bechtel et al., the entire disclosure of which is incorporated herein byreference. In a preferred embodiment, the processing systemindependently controls the exposure of various subwindows of the imagesensor array 32 in the manner described further below.

A suitable microcontroller 38 is a Motorola STAR 12™, part No.MCS912D64. In the event that the microcontroller does not containsufficient random access memory (RAM) to store an entire image from theimage sensor, the windowing feature of the CMOS imaging sensors may beused to alternatively image and process different regions of a smallenough size for the onboard RAM of the microcontroller 38.Alternatively, the in-line processing procedure disclosed in commonlyassigned U.S. patent application No. 6,631,316, entitled “IMAGEPROCESSING SYSTEM TO CONTROL VEHICLE HEADLAMPS AND OTHER VEHICLEEQUIPMENT,” filed on Mar. 5, 2001, by Joseph S. Stam et al. may be usedto reduce the memory requirements of the processor. The entiredisclosure of the '316 patent is incorporated herein by reference.

Once an image is acquired by the image sensor 32, the luminance of eachpixel, represented by an analog voltage, is converted to a digitalgrayscale value by the analog-to-digital converter 35. These values arewritten to memory, which may be on board the microcontroller 38 andprocessed by the microcontroller 38 or alternatively a digital signalprocessor.

To further enhance the accuracy of the system and to enable the systemto distinguish between raindrops and windshield cracks or debris on thewindshield, the processing system 38 preferably utilizes edge detectiontechniques and may analyze the spatial high frequency components of theimage(s). More specifically, raindrops are detected by quantifying thediscontinuity resulting from sharp edges of the raindrops on thewindshield. These sharp edges are caused by the focused images of therain or other moisture droplet along with the random optical imaging offar-field objects by the droplets or other moisture. Laplacian, Sobel,or preferably Prewitt filtering may be employed for detecting the edgesin the images.

As shown in FIG. 8, image sensor array 32 may effectively be dividedinto a plurality of subwindows 110. In the case of an image sensor array32 having sixty-four columns of pixels and eighty rows of pixels, asuitable subwindow 110 may be formed of an 8×8 block of the pixelsforming image array sensor 32. In this manner, image sensor array 32 maybe effectively divided into an array of 8×10 subwindows. As used herein,a subwindow may include a block of contiguous pixels, a single line ofpixels, alternating lines of pixels, or various other combinations ofpixels corresponding to a subset of all the pixels of the array.

The processing system analyzes the images from each of the plurality ofsubwindows 110 (FIG. 8) of the image sensor array 32 for sharpdiscontinuities caused by the edges of the water rain droplets or othermoisture and by random focusing of the distant objects by the droplets.These discontinuities represent high spatial frequency components. Thespatial distribution of the detected edges may be used to distinguishmoisture on the windshield from other objects such as bugs, debris, orheadlamps of oncoming vehicles or tail lights of preceding vehiclesbecause rain is typically much more evenly distributed across the imagedportion of the windshield. An indicator of the spatial distribution ofthe detected edges is the number of subwindows 110 in which edges aredetected. The greater the number of subwindows in which edges aredetected, the greater the spatial distribution of the detected edges andhence the objects that are on the windshield. Moreover, the greater thespatial distribution of the objects, the greater the magnitude ofmoisture and hence the faster the windshield wipers should be operated.The magnitude of the spatial high frequency components and the number ofsubwindows 110 in which edges are detected are used to control awindshield wiper motor control 40 (FIG. 7) such that the frequency ofwiping of the windshield wiper blades (i.e., time interval betweenwipes) is controlled as a function of the amount of moisture on thewindshield. Alternatively, the wipers may be activated each time athreshold level of moisture on the window (i.e., number of subwindows inwhich edges are detected) is reached.

The system is also able to adapt to varying light levels. In particular,during selected cycles, the average grayscale value of the image may becomputed. If this value is high, indicating an overexposure to light,the exposure time of the image sensor may be reduced to lower theaverage brightness. Similarly, if the light level is low, the exposuretime may be increased. The specific manner in which the exposure time ofthe image sensor is adjusted is discussed further below.

When the image obtained by image sensor array 32 is divided intosubwindows 110, the sensitivity/exposure time of each of the subwindows110 may be independently adjusted. Alternatively, theexposure/sensitivity level of the image sensor array 32 may be varied asa whole. When varying the sensitivity of the image sensor array as awhole, the average grayscale value of the pixels may be computed and thesensitivity adjusted (as described further below) to maintain theaverage grayscale value within predefined limits. However, whenadjusting the sensitivity of the image sensor array 32 as a whole,far-field light sources, such as those from an oncoming vehicle, maycause large intrascene illumination variations. If these largevariations are not taken into account, parts of the image may beoverexposed or underexposed, which reduces the detectable contrastcaused by rain on the windshield. It is therefore preferable to adjustthe sensitivity of the subwindows independent of one another based uponthe average grayscale value output from the pixels of the subwindow.Thus, if bright headlights from an oncoming vehicle produce large brightspots in only two of the eighty subwindows of the image sensor array 32,the exposure/sensitivity of those subwindows may be reduced relative tothat of the remaining subwindows without also reducing the sensitivityof the remaining subwindows and thereby maintaining the sensitivity andcontrast within those other subwindows.

By independently controlling the sensitivity of subwindows within imagesensor array 32, the system may be configured to adjust the sensitivityof those subwindows imaging the portion of the image above the horizonrelative to those subwindows imaging a portion of the image below thehorizon. This may be quite significant during those periods during whichthe sky is relatively bright compared to the road and othersurroundings.

Regardless of whether exposure is adjusted on a per subwindow basis, thebasic automatic gain control (AGC) algorithm, which may be performed bymicrocontroller 38, is the same. First, in order to reduce computationalrequirements, the AGC algorithm preferably uses integer arithmetic only.The algorithm works by first calculating the pixel average of either theentire image sensor array or the subwindow under consideration. If thisaverage is already within a specified band (the image is alreadyproperly exposed), then the next exposure for the subwindow/image sensorarray is left unchanged. Otherwise, the algorithm continues by comparingthe pixel average target with the current pixel average. If the targetis larger than the current average, then the exposure for the subwindowor whole image sensor array will be adjusted higher. Likewise, if thepixel average target is smaller then the current image window pixelaverage, the exposure is adjusted lower. In both cases, the differencebetween the current pixel average and the target is calculated. Thisdifference is then adjusted depending on the current exposure value andadded or subtracted as appropriate to the current exposure in order tocreate the new exposure value. This difference value adjustment may beperformed by logic left or right shifts, which effectively multiply ordivide the exposure value by increasing powers of two. The reason thismay be preferable is that the imager results are much more sensitive tosmall absolute changes in exposure when the current exposure value issmall. The AGC algorithm makes similar adjustments on a percentage basisacross the large exposure value range without using floating-pointarithmetic. Minimum and maximum exposure value constants may be used toclip all exposure values generated by the AGC algorithm. This limits theexposure range to avoid noise problems at very small exposures andtiming problems (in sufficient frame rate) at very large exposures.

In addition to the AGC algorithm discussed above, the exposure level ofthe array or of subwindows or individual pixels may also be adjusted byvarying the analog-to-digital conversion parameters of ADC 35, oradjusting the analog gain of the sensor outputs.

As noted above, it is preferable to make use of the “distributed”property of rain to help identify rain images. When it is raining, ingeneral the raindrops tend to be spread somewhat evenly across theentire image. Far-field lights, however, tend to show up in a morelocalized manner. To detect bright lights in the subwindows, the averagepixel variation is determined. The average pixel variation is defined asthe average absolute difference between the pixel value and the pixelgrayscale average across the entire subwindow. The bright far-fieldlights cause extremely high contrast in the imaged subwindows, whichalso results in a high pixel variation in the subwindow. Normallyexposed raindrops cause lower pixel variations. Thus, each subwindow maybe tested against a maximum pixel variation threshold to determine ifthe subwindow should be considered for further rain processing. If theaverage pixel variation for a subwindow exceeds the maximum pixelvariation threshold, microcontroller 38 may exclude the subwindow fromthe subwindow count upon which microcontroller 38 determines if rain ispresent.

Although the preferred embodiment has been disclosed as utilizing eightysubwindows of 8×8 pixels each, it will be appreciated by those skilledin the art that any number of subwindows may be utilized of anyresolution. In general, the greater the number of subwindows, thegreater the ability of the system to block out and ignore brightfar-field objects or faulty pixels. However, arbitrarily increasing thenumber of subwindows will decrease the resolution within each subwindowdue to the limited number of pixels in the entire array. If the numberof pixels within a subwindow is too small, then the average valuecomputed for the subwindow will vary more significantly and be morelikely to produce inconsistent results across the entire image sensorarray. Also, it will become more likely that an edge lies betweensubwindows that could go undetected.

An example of an image sensor suitable for use in the present inventionis disclosed in commonly assigned U.S. Pat. No. 6,008,486, entitled“WIDE DYNAMIC RANGE OPTICAL SENSOR,” by Joseph S. Stam et al., theentire disclosure of which is incorporated herein by reference.

By taking advantage of the inherent memory in the sensor circuits,correlated double samples may be obtained directly from the image sensorto subtract out the ambient light and thus reduce the memoryrequirements of the processor or associated external memory. Anothermethod for preserving memory in the event that the above-notedcorrelated double sampling inherent in the sensor circuit is notutilized, is for microcontroller 38 to read the image data one row at atime, first with illumination and then without illumination utilizing aone-dimensional filter to subtract out the image data of the row withand without illumination from one another. The result may then be storedin the RAM associated with the microcontroller 38 prior to reading thenext row with and without illumination.

The system described above may also be used to detect the passing of thewiper blades past the imaged area of the windshield. If the wipers ofthe automobile are designed in such a way that the wipers are neverapproximately vertical when it crosses the imaged area, the filtersdescribed above can be modified to accommodate such a configuration. Forexample, various other edge detection methods well known in the art ofimage processing can also be used. Additionally, if the wiper speed forthe vehicle windshield wipers is so fast that it blurs slightly in theimage for the necessary exposure time, the horizontal filter can bemodified to subtract the pixels two positions to the left and right ofthe current pixel instead of the pixels immediately next to the currentpixel.

After the wiper has cleared the imaged area, additional images of thewindshield are acquired. These images may be used as a zero pointmeasurement that may be subtracted from all subsequent measurementsuntil the next wipe. In this way, long-term high frequency spatialcomponents in the image of dirty windshield, cracks, scratches, andfrozen ice will not contribute to the detected amount of rain.

If the windshield wiper is not detected within a given time frame, thesystem assumes that a malfunction has occurred, which can be caused as aresult of the windshield wiper being frozen to the windshield. Duringsuch a condition, the operation of the moisture sensor in accordancewith the present invention can be suspended for a period of time toallow the ice to thaw. If outside temperature information is available,freezing climate conditions can be taken into account to decide if thewipers are failing because of a mechanical malfunction or due to ice.

In order to provide selectivity of a system, a driver on/off sensitivitycontrol circuit 44 (FIG. 7) may be provided. The intermittent wipercontrol may be used to allow adjustment of the system's sensitivity.This control circuit 44 may be used in special circumstances, forexample, when the vehicle is in an automatic car wash to preventspurious operation of the system. Because some drivers will often engagetheir windshield wipers while driving through an automatic car wash,which increases the possibility that the wipers will be damaged by beingbent or torn from the vehicle, it would be desirable to configure thewiper control system to be responsive to a signal from a remote deviceso as to at least temporarily disable the wipers from operation duringsuch time that the vehicle is traveling through the car wash. This maybe accomplished by providing a transmitter that transmits a relativelylow strength IR or RF signal at the entrance to the automatic car washwithin the frequency band of most remote keyless entry receivers (202)that are now commonly provided in vehicles. The signal may be modulatedwith a standard code that is then transmitted over the vehicle bus orotherwise transmitted directly to microcontroller 38, which recognizesthis signal and responds by generating a signal to disable the vehicle'swindshield wipers either for a predetermined time period followingreceipt of this disable signal or until such time that a subsequentsignal is received at the exit of the car wash at which point themicrocontroller 38 may toggle a wiper disable flag to permit theoperation of the wipers under control of the moisture sensing system ofthe present invention or under manual control. This is particularlyadvantageous when the driver enters the automatic car wash with thewiper control in the automatic mode, since the moisture sensing systemwould detect moisture when the vehicle has entered the car wash and thenotherwise attempt to activate the windshield wipers thereby riskingtheir destruction.

Other mechanisms by which operation of the automatic wiper system couldbe disabled are disclosed in commonly assigned U.S. patent applicationSer. No. 09/827,304 entitled “VEHICLE REARVIEW MIRROR ASSEMBLYINCORPORATING COMMUNICATION SYSTEM,” by Robert R. Turnbull et al., onApr. 5, 2001, which was published as U.S. Patent Application PublicationNo. 2002/0032510 A1, the entire disclosure of which is incorporatedherein by reference. For example, microcontroller 38 could be coupled toa microwave receiver that receives signals from a plurality ofsatellites such as GPS satellites. The microcontroller 38 may thendisable or enable automatic activation of the windshield wipers inresponse to information obtained from the microwave receiver. Suchinformation may, for example, indicate that the microwave receiver isreceiving signals from less than a predetermined number of GPSsatellites thereby indicating that the vehicle has entered an enclosedarea, such as a car wash or parking garage. Alternatively, GPSinformation, upon which microcontroller 38 may otherwise deactivate oractivate the automatic windshield wipers, may include vehicle locationdata that may be compared to a database of known locations of automaticcar washes.

The system of the present invention may also include a mechanism fordetecting fog on the inside or outside surface of the windshield. Such amechanism is disclosed in U.S. Pat. No. 5,923,027, the entire disclosureof which is incorporated herein by reference. To implement such a fogdetecting mechanism with the moisture sensing system of the presentinvention, an illuminator 66, such as an LED, would be added in additionto supplemental illuminator 102. Unlike illuminator 102, whichilluminates the entire imaged area of the windshield, the additionalilluminator 66 would be configured to project a focussed spot of lightonto the windshield that is then sensed using one or both of the imagesensor arrays.

According to another embodiment of the present invention, a fog detector160 is provided for detecting the presence of fog on either the insideor outside of a window 26. Window 26 may be any of the windows in avehicle or may be a window other than in a vehicle. Fog detector 160includes an emitter 164 and a sensor 166 disposed with their opticalaxes generally in parallel. Emitter 164 and sensor 166 are preferablymounted in very close proximity, if not in contact with one another,within a housing 162. The optical axis of the emitter is preferablyoriented with respect to the window such that the light emittedtherefrom does not impinge the window at an angle causing the light toenter and be internally reflected within the window as are some forms ofprior art moisture sensors. Housing 162 may be the housing of a rearviewmirror assembly when window 26 is the front windshield of the vehicle ormay be a housing on the mount of the rearview mirror assembly.Alternatively, housing 162 may be incorporated into a centerhigh-mounted stoplight (CHMSL) assembly or any other vehicle accessoryadjacent a vehicle window. Examples of such vehicle accessories ormounting locations include the rear dash, the instrument panel dash, theheadliner, an overhead console, a window-mounted console, A-, B-, orC-pillars, etc.

Emitter 164 may be virtually any light source and is preferably an LED.Emitter 164 preferably emits infrared radiation so as to not project avisible spot on the window. The optics of the emitter is preferably suchthat the light it emits is divergent rather than focussed to a spot.

Sensor 166 may be any form of sensor that is sensitive to the radiationemitted from emitter 164. The field of view of sensor 166 is preferablyessentially equivalent to the angle of emission of emitter 164 on window26. Sensor 166 may be a CdS sensor or a CMOS photodiode of the typedisclosed in the above-referenced U.S. Pat. No. 6,359,274. If the fogdetector 160 is implemented in a rearview mirror assembly and therearview mirror assembly incorporates an electrochromic mirror, sensor166 may also function as a forward ambient light sensor whose output isutilized in determining the reflectance level of the electrochromicmirror.

Fog detector 160 further includes a control circuit 170, which may beanalog, or include a microcontroller. Control circuit 170 may or may notbe housed within the same housing 162 as emitter 164 and sensor 166.Control circuit 170 is communicatively coupled to the climate control172 of the vehicle, which in turn is coupled to the defogger/defroster174. Defogger/defroster 174 may be type that blows air onto the interiorsurface of window 26 or may be the type used on a rear window and havingone or more electric heating elements for heating the interior surfaceof the rear window 26.

In general, control circuit 170 selectively and periodically activatesemitter 164 while sensing the output of sensor 166 both when emitter 164is activated and when it is not activated. Control circuit 170 may becalibrated during such time that window 26 is clear to determine thelight level difference sensed by sensor 166 when emitter 164 isactivated and when it is not activated. This calibrated difference maythen be utilized to establish a threshold difference for comparison ofthe sensed differences later obtained during use. When there is a fog onthe inside or outside of window 26, the light is diffused and reflectedback towards sensor 166 thereby creating a much greater difference inlight levels sensed by sensor 166 when emitter 164 is activated anddeactivated. When this difference reaches a threshold level, controlcircuit 170 may generate a signal to the climate control system 172 tocause the defroster 174 to be activated. Control circuit 170 may beconnected by a discrete line to climate control 172 or it maycommunicate therewith either over the vehicle bus or via a wirelesslink. By sensing the light level without emitter 164 activated, controlcircuit 170 may determine the relative ambient light level and adjustthe levels otherwise sensed when emitter 164 is activated for thedetected ambient light level.

While fog detector 160 is preferably calibrated during vehiclemanufacture, it may subsequently automatically calibrate at such timesthat the vehicle windshield is clear. Such subsequent automaticcalibration may be desirable in view of the fact that the windshield mayotherwise be dirty or include a film as is often caused by smokingcigarettes within the vehicle. Control circuit 170 may utilize climateinformation from climate control 172 or from other sources to determinewhen window 26 would otherwise be clear of fog. Clearly, it would bedesirable to avoid activating defogger/defroster 174 when the window ismerely dirty and such activation of defogger/defroster 174 will notassist in clearing window 26. Information that control circuit 170 mayutilize in determining whether the windshield should otherwise be clearmay include sensed conditions such as provided from interior andexterior temperature sensors and humidity sensors that may otherwise beused in the vehicle. For example, a comparison of the interior andexterior temperatures will typically indicate whether it is evenpossible for there to be fog on the vehicle windshield. Additionally,control circuit may determine whether fog is possible by monitoring theoutput of sensor 166 over time following activation of the defroster174. For example, as detected fog the windshield decreases over time,the output of the sensor 166 approaches a constant level representing abaseline for that windshield. This baseline may not necessarilyrepresent a perfectly clear windshield, since the windshield may becoated with a layer of dirt or soot from smoking in the vehicle. Thebaseline can then be stored for use in subsequent comparisons forautomatically activating the defroster 174.

By minimizing the spacing between the optical axes of emitter 164 andsensor 166, the field of view of the sensor will more likely correspondto the projected spot of emitter 164 and the system may be positionedrelatively close, i.e., within six inches or less, of the interiorsurface of window 26. This would allow the fog detector 160 to beincorporated in many different forms of vehicle accessories that areprovided in proximity to the vehicle window. To minimize spacing ofemitter 164 and sensor 166, both may be encapsulated in a commonencapsulant.

Unlike other fog detecting systems previously known, the fog detector160 shown in FIG. 9 may be implemented at a relatively low cost therebymaking it practical to incorporate the inventive fog detecting system ina CHMSL assembly or other vehicle accessory in proximity to the rearwindshield of the vehicle for the function of controlling the reardefroster. Most rear defrosters generally are manually activated andremain active only for a predetermined period of time regardless ofwhether the rear window is already cleared. By utilizing the fogdetector of the present invention, the rear window or any other windowmay be maintained in a clear state without over-utilizing the climatecontrol system.

As shown in FIG. 7, the microcontroller 38 may also be coupled to avehicle headlamp circuit 200 for controlling the state of the vehicleheadlamps. Microcontroller 38 may control the state of the vehicleheadlamps, i.e., on/off mode (low-beam, high-beam, daytime runninglamps, brightness, aim., etc.), in response to images detected utilizingeither image sensor array 32 or an additional image sensor array that isotherwise coupled to microcontroller 38. Similarly, an additionalmicrocontroller 38 could be provided to read the information from imagesensor array 32 for the purpose of controlling vehicle headlamp circuit200. By combining components of the inventive moisture sensor systemwith a headlamp control circuit, duplication of parts may be minimizedthereby allowing the implementation of both features in a vehicle at arelatively low cost. Examples of such headlamp dimming systems aredisclosed in commonly-assigned U.S. Pat. Nos. 5,837,994, 6,049,171,6,255,639, and 6,281,632, the entire disclosures of which areincorporated herein by reference.

Also, by combining the system shown in FIG. 9 or the functional aspectsthereof with any vehicle-mounted system employing a camera (i.e.,systems for headlamp dimming, adaptive cruise control, collisionavoidance, lane departure detection, rear vision, night vision, etc.),one may determine whether the system's camera view is blocked or thewindow in front of the camera is merely fogged over. The system shown inFIG. 9 is sufficiently small to allow it to be incorporated within sucha camera behind any window it may have within its housing in order todetermine whether the camera's view is impaired. A second such systemmay then be employed to detect whether the vehicle window through whichthe camera captures images is foggy. Control of the camera and relatedsystems may then be adjusted or deactivated in response to suchinformation.

Occasionally when driving up a hill, the vehicle could be positioned insuch a way that the sun is directly imaged by the device. The radiativeloading caused by this alignment may damage the image sensor 32 overtime. In order to alleviate such a problem, an electrochromic filter maybe used to temporarily eliminate most of the sunlight from the imageplane. Other optical electronic or optical mechanical devices could alsobe used. It may be desirable that such a dynamic filter have a darkenedstate when power is removed such that the filter may function as aneffective shutter that is closed when the camera is not in use. By usingsuch a dynamic filter having a darkened state when no power applied, thefilter effectively blocks most light from reaching the camera even whenthe vehicle is turned off without drawing power and draining the vehiclebattery. Examples of such filters include electrochromic filtersemploying tungsten oxide, some LCD devices, and suspended particledevices.

Although the present invention has been described as utilizing atwo-dimensional array of sensors to capture a single image of a portionof the windshield, one or more one-dimensional sensor arrays or morethan one two-dimensional sensor arrays may be utilized as disclosed incommonly assigned U.S. Pat. No. 6,617,564, entitled “MOISTURE SENSORUTILIZING STEREO IMAGING WITH AN IMAGE SENSOR,” filed concurrentlyherewith by Harold C. Ockerse et al., the entire disclosure of which isincorporated herein by reference.

While the invention has been described in detail herein in accordancewith certain preferred embodiments thereof, many modifications andchanges therein may be effected by those skilled in the art withoutmaterially departing from the novel teachings and advantages of thisinvention. Accordingly, all such modifications are intended to beincluded within the scope of this invention as defined in the followingclaims and, therefore, it is our intent to be limited only by the scopeof the appending claims and not by way of the details andinstrumentalities describing the embodiments shown herein.

1. A fog detector system for detecting fog on an inside surface of avehicle window, said fog detector system comprising: an emitter forselectively projecting radiation onto a region of the inside surface ofthe vehicle window; a sensor disposed with its optical axissubstantially in parallel with that of said emitter, said sensor beingsensitive to the radiation projected by said emitter for sensing levelsof incident radiation both when said emitter projects radiation and whensaid emitter does not project radiation; and a control circuit coupledto said emitter for selectively activating said emitter, and coupled tosaid sensor for receiving signals from said sensor representing thelevel of incident radiation, said control circuit determines thedifference between levels of incident radiation when said emitter isactivated and when said emitter is deactivated, and compares thedifference to a threshold to determine whether fog is present, saidcontrol circuit generates a signal indicating the presence of fog on thevehicle window.
 2. The fog detector system of claim 1, wherein saidcontrol circuit generates a signal to cause a defogger to be activatedwhen fog is present.
 3. The fog detector system of claim 2, wherein saidcontrol circuit generates a signal to cause the defogger to bedeactivated when fog is no longer detected.
 4. The fog detector systemof claim 1, wherein said control circuit generates a signal to cause adefogger to be deactivated when fog is no longer detected.
 5. The fogdetector system of claim 1, wherein said emitter is an LED.
 6. The fogdetector system of claim 1, wherein said sensor is a photodiode.
 7. Thefog detector system of claim 1 and further comprising a housing in whichsaid emitter and sensor are supported.
 8. The fog detector system ofclaim 7, wherein said control circuit is housed in said housing.
 9. Thefog detector system of claim 7, wherein said housing is a mirror housingof a rearview mirror assembly.
 10. The fog detector system of claim 7,wherein said housing is integrated in a CHMSL assembly.
 11. The fogdetector system of claim 2, wherein the vehicle window is a rear windowand said defogger is a rear window defogger.
 12. The fog detector systemof claim 1, wherein said control circuit calibrates to redefine saidthreshold when said control circuit determines that the vehicle windowis clear of fog.
 13. The fog detector system of claim 12, wherein saidcontrol circuit is configured to receive climate information upon whichsaid control circuit may determine that the vehicle window is clear offog.
 14. The fog detector system of claim 13, wherein the climateinformation includes any one or combination of: interior temperature,exterior temperature, humidity, and defogger activation status.
 15. Amethod of detecting fog on an inside surface of a vehicle windshieldcomprising: providing a sensor and an emitter disposed with theiroptical axes substantially in parallel and aimed generally at a regionof the inside surface of the vehicle window; selectively projectingradiation from said emitter onto said region of the inside surface ofthe vehicle window; sensing levels of incident radiation when saidemitter projects radiation and when said emitter does not projectradiation; determining the difference between levels of incidentradiation when said emitter projects radiation and when said emitterdoes not project radiation; and comparing the difference to a thresholdto determine whether fog is present.
 16. The method of claim 15, whereinsaid emitter is an LED.
 17. The method of claim 1, wherein said sensoris a photodiode.
 18. The method of claim 15 and further comprisingcalibrating and redefining said threshold when the vehicle window isclear of fog.
 19. A fog detector system for detecting fog on an insidesurface of a vehicle window, said fog detector system comprising: an LEDfor selectively projecting radiation onto a region of the inside surfaceof the vehicle window; a sensor disposed with its optical axissubstantially in parallel with that of said emitter, said sensor beingsensitive to the radiation projected by said emitter for sensing levelsof incident radiation both when said LED projects radiation and whensaid LED does not project radiation; and a control circuit coupled tosaid emitter for selectively activating said emitter, and coupled tosaid sensor for receiving signals from said sensor representing thelevel of incident radiation, said control circuit determines thedifference between levels of incident radiation when said LED projectsradiation and when said LED does not project radiation, and compares thedifference to a threshold to determine whether fog is present, saidcontrol circuit generates a signal to cause a defogger to be activatedwhen fog is present and to cause the defogger to be deactivated when fogis no longer detected.
 20. The fog detector system of claim 19, whereinsaid sensor is a photodiode.
 21. The fog detector system of claim 19,wherein said LED and said sensor are integrated in a CHMSL assembly. 22.The fog detector system of claim 19, wherein the vehicle window is arear window and the defogger is a rear window defogger.
 23. The fogdetector system of claim 19, wherein said control circuit calibrates toredefine said threshold when said control circuit determines that thevehicle window is clear of fog.